import service from "@/service";

//列表
export function getList(data) {
  let { page, pageSize, tenantCode = "", groupName } = data;
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/user/sys-group/getList?page=${page}&pageSize=${pageSize}`,
    method: "POST",
    data: {
      tenantCode,
      groupName,
    },
  });
}

//删除
export function deleteGroup(data) {
  let { id = "" } = data;
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/user/sys-group/delete?id=${id}`,
    method: "POST",
  });
}

//新增
export function addGroup(data) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/user/sys-group/add`,
    method: "POST",
    data,
  });
}

//编辑
export function editorGroup(data) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/user/sys-group/update`,
    method: "POST",
    data,
  });
}

//人员列表
export function getUserList(data) {
  let { tenantCode = "" } = data;
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/user/sys-user/queryUsersByTenantCode?tenantCode=${tenantCode}`,
    method: "POST",
  });
}
